﻿<%@ Page Language="VB" Debug="true" MasterPageFile="~/banner.Master"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script runat="server">
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
    Dim MyItem as ListItem
    lblMessage.Text = ""
    For Each MyItem in cbl1.Items
        If MyItem.Selected = True Then
                lblMessage.Text = lblMessage.Text & MyItem.Text & "<BR>"
        End If
    Next
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Creating a Basic CheckBoxList Control</TITLE>
</HEAD>
<BR><BR>
<asp:Label
    id="lblMessage"
    runat="server"
/>
<BR><BR>
<asp:checkboxlist 
    id="cbl1" 
    runat="server"
    cellpadding="5"
    cellspacing="5"
    repeatcolumns="3"
    repeatdirection="Horizontal"
    repeatlayout="Table"
    textalign="Right"
>
    <asp:ListItem value="12">Blue</asp:ListItem>
    <asp:ListItem value="11">Red</asp:ListItem>
    <asp:ListItem value="2">Green</asp:ListItem>
    <asp:ListItem value="32">Purple</asp:ListItem>
    <asp:ListItem value="8">Black</asp:ListItem>
    <asp:ListItem value="15" Selected>Gold</asp:ListItem>
</asp:checkboxlist>
<BR><BR>
<asp:button 
    id="butOK"
    text="OK"
    type="Submit"
    onclick="SubmitBtn_Click" 
    runat="server"
/>
</form>
</BODY>
</HTML>
</asp:Content>
